package com.whately.core.base.fileupload.constant;

import lombok.Getter;

/**
 * 文件传输方式
 */
@Getter
public enum FileSenderTypeEnum {

    //字节数组
    bytes_array(0),

    //file
    file(1),

    //流
    input_stream(2),





    ;


    Integer code;

    private FileSenderTypeEnum(int code) {
        this.code = code;
    }

    public static FileSenderTypeEnum getEnumByCode(Integer code){
        if(code==null){
            return null;
        }

        for(FileSenderTypeEnum e: FileSenderTypeEnum.values()){
            if(e.code.equals(code)){
                return e;
            }
        }
        return null;
    }


}
